{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from keras import backend as K\n",
    "import matplotlib.pyplot as plt\n",
    "import keras"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "def jaccard_distance_loss(y_true, y_pred, smooth=100):\n",
    "    \"\"\"\n",
    "    Jaccard = (|X & Y|)/ (|X|+ |Y| - |X & Y|)\n",
    "            = sum(|A*B|)/(sum(|A|)+sum(|B|)-sum(|A*B|))\n",
    "    \n",
    "    The jaccard distance loss is usefull for unbalanced datasets. This has been\n",
    "    shifted so it converges on 0 and is smoothed to avoid exploding or disapearing\n",
    "    gradient.\n",
    "    \n",
    "    Ref: https://en.wikipedia.org/wiki/Jaccard_index\n",
    "    \n",
    "    @url: https://gist.github.com/wassname/f1452b748efcbeb4cb9b1d059dce6f96\n",
    "    @author: wassname\n",
    "    \"\"\"\n",
    "    intersection = K.sum(K.abs(y_true * y_pred), axis=-1)\n",
    "    sum_ = K.sum(K.abs(y_true) + K.abs(y_pred), axis=-1)\n",
    "    jac = (intersection + smooth) / (sum_ - intersection + smooth)\n",
    "    return (1 - jac) * smooth\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[-1.00000000e+01]\n",
      " [-9.90000000e+00]\n",
      " [-9.80000000e+00]\n",
      " [-9.70000000e+00]\n",
      " [-9.60000000e+00]\n",
      " [-9.50000000e+00]\n",
      " [-9.40000000e+00]\n",
      " [-9.30000000e+00]\n",
      " [-9.20000000e+00]\n",
      " [-9.10000000e+00]\n",
      " [-9.00000000e+00]\n",
      " [-8.90000000e+00]\n",
      " [-8.80000000e+00]\n",
      " [-8.70000000e+00]\n",
      " [-8.60000000e+00]\n",
      " [-8.50000000e+00]\n",
      " [-8.40000000e+00]\n",
      " [-8.30000000e+00]\n",
      " [-8.20000000e+00]\n",
      " [-8.10000000e+00]\n",
      " [-8.00000000e+00]\n",
      " [-7.90000000e+00]\n",
      " [-7.80000000e+00]\n",
      " [-7.70000000e+00]\n",
      " [-7.60000000e+00]\n",
      " [-7.50000000e+00]\n",
      " [-7.40000000e+00]\n",
      " [-7.30000000e+00]\n",
      " [-7.20000000e+00]\n",
      " [-7.10000000e+00]\n",
      " [-7.00000000e+00]\n",
      " [-6.90000000e+00]\n",
      " [-6.80000000e+00]\n",
      " [-6.70000000e+00]\n",
      " [-6.60000000e+00]\n",
      " [-6.50000000e+00]\n",
      " [-6.40000000e+00]\n",
      " [-6.30000000e+00]\n",
      " [-6.20000000e+00]\n",
      " [-6.10000000e+00]\n",
      " [-6.00000000e+00]\n",
      " [-5.90000000e+00]\n",
      " [-5.80000000e+00]\n",
      " [-5.70000000e+00]\n",
      " [-5.60000000e+00]\n",
      " [-5.50000000e+00]\n",
      " [-5.40000000e+00]\n",
      " [-5.30000000e+00]\n",
      " [-5.20000000e+00]\n",
      " [-5.10000000e+00]\n",
      " [-5.00000000e+00]\n",
      " [-4.90000000e+00]\n",
      " [-4.80000000e+00]\n",
      " [-4.70000000e+00]\n",
      " [-4.60000000e+00]\n",
      " [-4.50000000e+00]\n",
      " [-4.40000000e+00]\n",
      " [-4.30000000e+00]\n",
      " [-4.20000000e+00]\n",
      " [-4.10000000e+00]\n",
      " [-4.00000000e+00]\n",
      " [-3.90000000e+00]\n",
      " [-3.80000000e+00]\n",
      " [-3.70000000e+00]\n",
      " [-3.60000000e+00]\n",
      " [-3.50000000e+00]\n",
      " [-3.40000000e+00]\n",
      " [-3.30000000e+00]\n",
      " [-3.20000000e+00]\n",
      " [-3.10000000e+00]\n",
      " [-3.00000000e+00]\n",
      " [-2.90000000e+00]\n",
      " [-2.80000000e+00]\n",
      " [-2.70000000e+00]\n",
      " [-2.60000000e+00]\n",
      " [-2.50000000e+00]\n",
      " [-2.40000000e+00]\n",
      " [-2.30000000e+00]\n",
      " [-2.20000000e+00]\n",
      " [-2.10000000e+00]\n",
      " [-2.00000000e+00]\n",
      " [-1.90000000e+00]\n",
      " [-1.80000000e+00]\n",
      " [-1.70000000e+00]\n",
      " [-1.60000000e+00]\n",
      " [-1.50000000e+00]\n",
      " [-1.40000000e+00]\n",
      " [-1.30000000e+00]\n",
      " [-1.20000000e+00]\n",
      " [-1.10000000e+00]\n",
      " [-1.00000000e+00]\n",
      " [-9.00000000e-01]\n",
      " [-8.00000000e-01]\n",
      " [-7.00000000e-01]\n",
      " [-6.00000000e-01]\n",
      " [-5.00000000e-01]\n",
      " [-4.00000000e-01]\n",
      " [-3.00000000e-01]\n",
      " [-2.00000000e-01]\n",
      " [-1.00000000e-01]\n",
      " [-3.55271368e-14]\n",
      " [ 1.00000000e-01]\n",
      " [ 2.00000000e-01]\n",
      " [ 3.00000000e-01]\n",
      " [ 4.00000000e-01]\n",
      " [ 5.00000000e-01]\n",
      " [ 6.00000000e-01]\n",
      " [ 7.00000000e-01]\n",
      " [ 8.00000000e-01]\n",
      " [ 9.00000000e-01]\n",
      " [ 1.00000000e+00]\n",
      " [ 1.10000000e+00]\n",
      " [ 1.20000000e+00]\n",
      " [ 1.30000000e+00]\n",
      " [ 1.40000000e+00]\n",
      " [ 1.50000000e+00]\n",
      " [ 1.60000000e+00]\n",
      " [ 1.70000000e+00]\n",
      " [ 1.80000000e+00]\n",
      " [ 1.90000000e+00]\n",
      " [ 2.00000000e+00]\n",
      " [ 2.10000000e+00]\n",
      " [ 2.20000000e+00]\n",
      " [ 2.30000000e+00]\n",
      " [ 2.40000000e+00]\n",
      " [ 2.50000000e+00]\n",
      " [ 2.60000000e+00]\n",
      " [ 2.70000000e+00]\n",
      " [ 2.80000000e+00]\n",
      " [ 2.90000000e+00]\n",
      " [ 3.00000000e+00]\n",
      " [ 3.10000000e+00]\n",
      " [ 3.20000000e+00]\n",
      " [ 3.30000000e+00]\n",
      " [ 3.40000000e+00]\n",
      " [ 3.50000000e+00]\n",
      " [ 3.60000000e+00]\n",
      " [ 3.70000000e+00]\n",
      " [ 3.80000000e+00]\n",
      " [ 3.90000000e+00]\n",
      " [ 4.00000000e+00]\n",
      " [ 4.10000000e+00]\n",
      " [ 4.20000000e+00]\n",
      " [ 4.30000000e+00]\n",
      " [ 4.40000000e+00]\n",
      " [ 4.50000000e+00]\n",
      " [ 4.60000000e+00]\n",
      " [ 4.70000000e+00]\n",
      " [ 4.80000000e+00]\n",
      " [ 4.90000000e+00]\n",
      " [ 5.00000000e+00]\n",
      " [ 5.10000000e+00]\n",
      " [ 5.20000000e+00]\n",
      " [ 5.30000000e+00]\n",
      " [ 5.40000000e+00]\n",
      " [ 5.50000000e+00]\n",
      " [ 5.60000000e+00]\n",
      " [ 5.70000000e+00]\n",
      " [ 5.80000000e+00]\n",
      " [ 5.90000000e+00]\n",
      " [ 6.00000000e+00]\n",
      " [ 6.10000000e+00]\n",
      " [ 6.20000000e+00]\n",
      " [ 6.30000000e+00]\n",
      " [ 6.40000000e+00]\n",
      " [ 6.50000000e+00]\n",
      " [ 6.60000000e+00]\n",
      " [ 6.70000000e+00]\n",
      " [ 6.80000000e+00]\n",
      " [ 6.90000000e+00]\n",
      " [ 7.00000000e+00]\n",
      " [ 7.10000000e+00]\n",
      " [ 7.20000000e+00]\n",
      " [ 7.30000000e+00]\n",
      " [ 7.40000000e+00]\n",
      " [ 7.50000000e+00]\n",
      " [ 7.60000000e+00]\n",
      " [ 7.70000000e+00]\n",
      " [ 7.80000000e+00]\n",
      " [ 7.90000000e+00]\n",
      " [ 8.00000000e+00]\n",
      " [ 8.10000000e+00]\n",
      " [ 8.20000000e+00]\n",
      " [ 8.30000000e+00]\n",
      " [ 8.40000000e+00]\n",
      " [ 8.50000000e+00]\n",
      " [ 8.60000000e+00]\n",
      " [ 8.70000000e+00]\n",
      " [ 8.80000000e+00]\n",
      " [ 8.90000000e+00]\n",
      " [ 9.00000000e+00]\n",
      " [ 9.10000000e+00]\n",
      " [ 9.20000000e+00]\n",
      " [ 9.30000000e+00]\n",
      " [ 9.40000000e+00]\n",
      " [ 9.50000000e+00]\n",
      " [ 9.60000000e+00]\n",
      " [ 9.70000000e+00]\n",
      " [ 9.80000000e+00]\n",
      " [ 9.90000000e+00]\n",
      " [ 1.00000000e+01]]\n",
      "[[0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]]\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAEICAYAAAB/Dx7IAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xd8FHX+x/HXJ42QEAglBEKA0EJPIVjOhqdYwAKKICiKvztPsVAU9cRyds9y4oEFxXKndMGuWBErp0cqLQRC7wkESEIgpHx/f+zgRUzIJtnd2d18no9HHmx2ZmfeOzt8dvKdme9XjDEopZTyHQF2B1BKKVU3WriVUsrHaOFWSikfo4VbKaV8jBZupZTyMVq4lVLKx2jhboREZI2InGt3juqIyLkisqMer/u3iDxuPT5bRHJcn86zRORbEbnR7hzK+wTZHUB5njGmr90Z3MkY8wPQs7b5RORhoLsxZqzbQynlQnrErWwjInrgoFQ9aOFuhERki4gMFpFTReQ/InJQRHaLyIsiElJlvr4i8pWIFIjIXhG5z3o+UETuE5GNIlIkImki0tGaNl1EtotIofX82VWW97CILBaROSJSCNwgIk2tZo4DIrIWOMXJ95AsIunW+hcCoVWm/aa5RUT+KiI7rXlzROR8EbkYuA+4WkSKRSTLmvf/RCTbmneTiNx84nJFZIqI5Fnb7P+qTG8qIs+JyFYROSQiP4pIU2va6SKy3NrWWXVtqhKRABF5wFp2noi8LSItrGmh1jbdby1/hYhEW9NusN5HkYhsFpFr67Je5aWMMfrTyH6ALcBgIAU4HUeTWRyQDUy25okAdgNTcBTFCOA0a9rdwCoczRECJAKtrWljgdbWMqcAe4BQa9rDQBkwHMdBQ1PgKeAHoBXQEVgN7KglfwiwFbgDCAauspb7uDX93OPLsDJuB2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q2UUj5GC7dSSvkYLdxKKeVjtHArpZSP+X+pEq1eh5JULgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "TYPE                 |Almost_right |half right |all_wrong\n",
      "jaccard_distance_loss [0.09900928 0.89108944 3.7500024 ]\n",
      "binary_crossentropy [ 0.02634021  0.57564634 12.532434  ]\n",
      "binary_crossentropy_scaled [0.00210176 0.04593252 1.        ]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'\\nTYPE                 |Almost_right |half right |all_wrong\\njaccard_distance_loss [ 0.09900928  0.89108944  3.75000238]\\nbinary_crossentropy [  0.02634021   0.57564634  12.53243446]\\nbinary_crossentropy_scaled [ 0.00210176  0.04593252  1.        ]\\n'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Test and plot\n",
    "y_pred = np.array([np.arange(-10, 10+0.1, 0.1)]).T\n",
    "y_true = np.zeros(y_pred.shape)\n",
    "print(y_pred)\n",
    "print(y_true)\n",
    "name='jaccard_distance_loss'\n",
    "try:\n",
    "    loss = jaccard_distance_loss(\n",
    "        K.variable(y_true),K.variable(y_pred)\n",
    "    ).eval(session=K.get_session())\n",
    "except Exception as e:\n",
    "    print(\"error plotting\", name ,e)\n",
    "else:\n",
    "    plt.title(name)\n",
    "    plt.plot(y_pred,loss)\n",
    "    plt.show()\n",
    "    \n",
    "# Test\n",
    "# Test\n",
    "print(\"TYPE                 |Almost_right |half right |all_wrong\")\n",
    "y_true = np.array([[0,0,1,0],[0,0,1,0],[0,0,1.,0.]])\n",
    "y_pred = np.array([[0,0,0.9,0],[0,0,0.1,0],[1,1,0.1,1.]])\n",
    "\n",
    "r = jaccard_distance_loss(\n",
    "    K.variable(y_true),\n",
    "    K.variable(y_pred),\n",
    ").eval(session=K.get_session())\n",
    "print('jaccard_distance_loss',r)\n",
    "assert r[0]<r[1]\n",
    "assert r[1]<r[2]\n",
    "\n",
    "r = keras.losses.binary_crossentropy(\n",
    "    K.variable(y_true),\n",
    "    K.variable(y_pred),\n",
    ").eval(session=K.get_session())\n",
    "print('binary_crossentropy',r)\n",
    "print('binary_crossentropy_scaled',r/r.max())\n",
    "assert r[0]<r[1]\n",
    "assert r[1]<r[2]\n",
    "\n",
    "\"\"\"\n",
    "TYPE                 |Almost_right |half right |all_wrong\n",
    "jaccard_distance_loss [ 0.09900928  0.89108944  3.75000238]\n",
    "binary_crossentropy [  0.02634021   0.57564634  12.53243446]\n",
    "binary_crossentropy_scaled [ 0.00210176  0.04593252  1.        ]\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
